<?php

namespace App\Http\Controllers;

use App\Models\DeliverMail;
use App\Models\Lockers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    /**
     * 用户头像
     * @var string[]
     */
    public static $user_icon = [
        1   => '/storage/default/icon/1.png',
        2   => '/storage/default/icon/2.png',
        3   => '/storage/default/icon/3.png',
        4   => '/storage/default/icon/user-1.png',
        5   => '/storage/default/icon/user-2.png',
        6   => '/storage/default/icon/dealer-1.png',
        7   => '/storage/default/icon/dealer-2.png',
        8   => '/storage/default/icon/storage.png',
        9   => '/storage/default/icon/storage-1.png',
        10  => '/storage/default/icon/storage-2.png',
        11  => '/storage/default/icon/logistics.png',
        12  => '/storage/default/icon/logistics-1.png',
        13  => '/storage/default/icon/logistics-2.png',
    ];

    /**
     * 输出json消息
     * @param int $code
     * @param string $msg
     * @param array $data
     * @return mixed|\Symfony\Component\HttpFoundation\ParameterBag|null
     */
    protected static function outJsonMsg(int $code, string $msg, array $data = [])
    {
        return response()->json([
            'code'  => $code,
            'msg'   => $msg,
            'data'  => $data,
        ]);
    }

    /**
     * 路由分离method
     */
    public function turn()
    {
        return __METHOD__;
    }
}
